﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
namespace Client.Controllers
{
    public class ModiFicationController : Controller
    {
        ModiFicase.ModiFicaSoapClient op = new ModiFicase.ModiFicaSoapClient();
        


        //
        // GET: /ModiFication/

        public ActionResult Index()
        {
          
            ServiceReference1.EmployeeLoginInfo_Model login = Session["LoginInfo"] as ServiceReference1.EmployeeLoginInfo_Model;
            ViewBag.id = login.EmployID;
            return View();
        }
        public string Changelist(int EmployID)
        {
            return JsonConvert.SerializeObject(op.person(EmployID));
        }
        public ActionResult schedule(int id)
        {
            ViewBag.id = id;
            return View();
             
        }
        public string man(int Situation_id)
        {
            return JsonConvert.SerializeObject(op.demand(Situation_id));
        }
        public ActionResult Leader()
        {
            ServiceReference1.EmployeeLoginInfo_Model login = Session["LoginInfo"] as ServiceReference1.EmployeeLoginInfo_Model;
            ViewBag.pid = login.PositionID;
            ViewBag.did = login.DeptID;
            return View();
        }
        public int Tong(int Situation_id)
        {
          return  op.Tong(Situation_id);
        }
        public int BuTong(int Situation_id)
        {
            return op.BuTong(Situation_id);
        }
        public string yici(int PositionID, int DeptID)
        {
            return JsonConvert.SerializeObject(op.YiJi(PositionID, DeptID));
        }
        public ActionResult Record_if()
        {
            return View();
        }
        //public string erci(int PositionID, int DeptID)
        //{
        //    return JsonConvert.SerializeObject(op.ErJi(PositionID, DeptID));
        //}
        public ActionResult koko()
        {
            ServiceReference1.EmployeeLoginInfo_Model login = Session["LoginInfo"] as ServiceReference1.EmployeeLoginInfo_Model;
            return View();
        }
        public ActionResult ModiFica()
        {
            ServiceReference1.EmployeeLoginInfo_Model login = Session["LoginInfo"] as ServiceReference1.EmployeeLoginInfo_Model;
            ViewBag.id = login.EmployID;
            return View();
        }
    
        public string Polist(int EmployID)
        {
            return JsonConvert.SerializeObject(op.Empl(EmployID));
        }
        public string EmployeIf(int EmployID)
        {
            return JsonConvert.SerializeObject(op.Empl(EmployID));
        }
        public string PosiIf(int id,int PositionID)
        {
            return JsonConvert.SerializeObject(op.Posi(id, PositionID));
        }
        public string DeptList()
        {
            return JsonConvert.SerializeObject(op.Delist());
        }
        public string Dep(int id)

        {
            return JsonConvert.SerializeObject(op.dept(id));
        }
        public ActionResult lolo()
        {
            return View();
        }
        public int  AddPerson(ModiFicase.PersonChange_Tab s)
        {
            int i = op.AddPer(s);
            return i;
        }
    }
}
